class config:
    need_pack=['requests','jieba']
    tts_init=False
class debug:
    def install_all_dependent_packages():
        """
        Install all dependent packages.
        Please make sure that PIP (Python Package index) is installed on your computer!
        """
        import os
        for i in config.need_pack:
            os.system(f'pip install {i}')
class init:
    def wintts() -> 'function object':
        """
        Initialize the Microsoft Windows TTS service and return a function object.
        """
        import win32com.client
        spk = win32com.client.Dispatch("SAPI.SpVoice")
        say=spk.Speak
        return say
    def hash():
        """
        Initialize hash functions.
        """
        import hashlib
        
class Type:
    class Telephonenumber:
        def __init__(self,num):
            "A Telephone number."
            self.num=num
class EpyError:
    class NotAValidTelephoneNumber(Exception):
        pass
def Telephone(call) -> Type.Telephonenumber:
    try:
        int(call)
    except:
        raise EpyError.NotAValidTelephoneNumber
    return Type.Telephonenumber(call)
class hash:
    def md5(string) -> 'md5':
        import hashlib
        return hashlib.md5(bytes(string,'ansi')).hexdigest()
    def sha1(string) -> 'sha1':
        import hashlib
        return hashlib.sha1(bytes(string,'ansi')).hexdigest()
    def sha224(string) -> 'sha224':
        import hashlib
        return hashlib.sha224(bytes(string,'ansi')).hexdigest()
    def sha256(string) -> 'sha256':
        import hashlib
        return hashlib.sha256(bytes(string,'ansi')).hexdigest()
    def sha384(string) -> 'sha384':
        import hashlib
        return hashlib.sha384(bytes(string,'ansi')).hexdigest()
    def sha512(string) -> 'sha512':
        import hashlib
        return hashlib.sha512(bytes(string,'ansi')).hexdigest()
    def sha3_224(string) -> 'sha3_224':
        import hashlib
        return hashlib.sha3_224(bytes(string,'ansi')).hexdigest()
    def sha3_256(string) -> 'sha3_256':
        import hashlib
        return hashlib.sha3_256(bytes(string,'ansi')).hexdigest()
    def sha3_384(string) -> 'sha3_384':
        import hashlib
        return hashlib.sha3_384(bytes(string,'ansi')).hexdigest()
    def sha3_512(string) -> 'sha3_512':
        import hashlib
        return hashlib.sha3_512(bytes(string,'ansi')).hexdigest()
    def shake_128(string,length) -> 'shake_128':
        import hashlib
        return hashlib.shake_128(bytes(string,'ansi')).hexdigest(length)
    def shake_256(string,length) -> 'shake_256':
        import hashlib
        return hashlib.shake_256(bytes(string,'ansi')).hexdigest(length)


